﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using webappdotnet;

public partial class Oefeningen : System.Web.UI.Page
{
    bool geladen = false;
    
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!User.IsInRole("Leerling"))
        {
            Response.Redirect("Default.aspx");
        }
        //esponse.Write(Queries.getOpdrachtenByLeerlingNaam(User.Identity.Name)
        GridView1.DataSource = Queries.getOpdrachtenByLeerlingNaam(User.Identity.Name);
        GridView1.DataBind();
        //GridView1.
        
    }

    protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
    {
        if (!geladen)
        {
            e.Row.Cells[1].Text = "ID";
            e.Row.Cells[2].Text = "Datum";
            e.Row.Cells[3].Text = "Moeilijkheidsgraad";
            e.Row.Cells[4].Text = "Maximum score";
            geladen = true;
        }
        e.Row.Cells[5].Visible = false;
    }
}
